import requests

DB_URL = "http://movie.douban.com/top250"


def getHtmlPage(url):
    headers = {
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36'

    }
    return requests.get(url, headers).content

from bs4 import  BeautifulSoup
html=getHtmlPage(DB_URL)
soup=BeautifulSoup(html)

# movie_list_soup = soup.find('ol', attrs={'class': 'grid_view'})
# for movie_li in  movie_list_soup.find_all('li'):
#     detail = movie_li.find('div', attrs={'class': 'hd'})
#     movie_name = detail.find('span', attrs={'class': 'title'}).getText()
#     print(movie_name,"-->>",detail)

for a in soup.find_all("a"):
    print(a["href"])